<!DOCTYPE html>
<html lang="en">
<head>
    <title>clock</title>
    <script>
        function displayTime(){
            var elt = document.getElementById("clock");
            var now = new Date();
            elt.innerHTML  = now.toLocaleTimeString();
            setTimeout(displayTime,1000);
        }
        window.onload = displayTime;
    </script>
    <style>
        #clock{
            font: bold 24pt sans;
            background: #ddf;
            padding: 10px;
            border: solid black 2px;
            border-radius: 10px;}
    </style>
</head>
<body>
<span id="clock"></span>
</body>
</html>

